public class Test {
    /*    public void addLast(int val) {
            ListNode node = new ListNode(val);
            if(head == null){
                head = node;
                return;
            }
            int current = head;
            while(current.next != null){
                current = current.next;
            }
            current.next = node;
        }*/
    /*    public void addIndex(int index, int val) {
    //1.判断index的合法性
    try{
        if(index<0 || index >size()){
            throw new IndexNotLegalException("index不合法");
        }
    }catch (IndexNotLegalException e){

    }
    //2.index == 0  || index == size()
    if(index == 0){
        //调用头插...
        return;
    }
    if(index == size()){
        //调用尾插...
        return;
    }
    //3. 找到index的前一个位置
        ListNode cur = findIndexSubOne(index);
    //4. 进行连接
        node.next = cur.next;
        cur.next = node;
    }
    private ListNode findIndexSubOne(int index) {
        ListNode current = head;
        while(index-1>0){
            current = current.next;
            index--;
        }
        return current;
    }*/
}

